package com.stormrage.edu.serv.shiro.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.stormrage.edu.serv.shiro.ShiroServ;
import com.stormrage.edu.serv.student.StuAcctServ;
import com.stormrage.entity.shiro.ShiroAcct;
import com.stormrage.entity.student.StuAcct;
import com.stormragetech.core.exception.StormrageTechException;

/**
 * @author www.stormragetech.com
 * @date 2016年3月30日
 * @version 1.0.0
 */
@Service
public class ShiroServImpl implements ShiroServ {

	private static final Logger logger = LoggerFactory.getLogger(ShiroServImpl.class);

	@Autowired
	private StuAcctServ acctServ;

	@Override
	public ShiroAcct queryAcctById(String arg0) throws StormrageTechException {

		logger.debug(" 【 Dao 】- 【 ShiroServ 】- 【 QueryAcctById 】- 开始 ");

		StuAcct acct = acctServ.queryById(Integer.valueOf(arg0));

		logger.debug(" 【 Dao 】- 【 ShiroServ 】- 【 QueryAcctById 】- 完成 ");
		return ShiroAcct.instance(acct);
	}

	@Override
	public ShiroAcct queryAcctByAcct(String arg0) throws StormrageTechException {

		logger.debug(" 【 Dao 】- 【 ShiroServ 】- 【 QueryAcctByAcct 】- 开始 ");

		StuAcct acct = acctServ.queryByAcct(arg0);

		logger.debug(" 【 Dao 】- 【 ShiroServ 】- 【 QueryAcctByAcct 】- 完成 ");
		return ShiroAcct.instance(acct);
	}

}
